<?php
/**
 *      @package WordPress
 *      @subpackage Carbon_Paper
 */

// Template directory access 
define("IMAGEPATH"      , TEMPLATEPATH . '/images/');
define("LANGUAGEPATH"   , TEMPLATEPATH . '/languages/');
define("INCLUDEPATH"    , TEMPLATEPATH . '/includes/');
define("WIDGETPATH"     , TEMPLATEPATH . '/includes/widgets/');
define("ADMINPATH"      , TEMPLATEPATH . '/includes/admin/');
define("PLUGINPATH"  	, TEMPLATEPATH . '/includes/plugin/');
define("METAPATH"       , TEMPLATEPATH . '/includes/meta/');
define("TYPEPATH"       , TEMPLATEPATH . '/includes/type/');



// Template url access
define('TEMPLATEURL', WP_CONTENT_URL . '/' . stristr(TEMPLATEPATH, 'themes') . '/');
define('PLUGINURL', TEMPLATEURL . 'includes/plugin/');

wp_enqueue_script('jquery-1.5',TEMPLATEURL . 'js/jquery-1.5.js');
//wp_enqueue_script('corner', TEMPLATEURL . 'js/jquery.curvycorners.source.js');


//Vote profiler
require_once (INCLUDEPATH . 'plugin/vote-profiler/class-controller.php');
$oController = CController::get_instance('options');

// Enqueue integrated plugin styles
wp_enqueue_style('reaction_buttons', TEMPLATEURL . 'css/reaction_buttons.css');
wp_enqueue_style('pagenavi', TEMPLATEURL . 'css/pagenavi-css.css');


// Include Carbon Paper functions 
require_once (INCLUDEPATH .     'get-the-image.php');                   // Get the image
require_once (INCLUDEPATH .     'carbonpaper_archives.php');    		// Carbon Paper Archives Display
require_once (INCLUDEPATH .     'setup.php');                         	// Carbon Paper Setup Functions
require_once (INCLUDEPATH .     'renderer.php');                        // Carbon Paper Render Functions
require_once (INCLUDEPATH .     'shortcodes.php');                      // Carbon Paper Display Shortcodes

// Include Carbon Paper types
require_once (TYPEPATH .      	'type-event.php');                           // Carbon Event Type
require_once (TYPEPATH .      	'type-legrandmix.php');                      // Carbon Le Grand Mix Type
require_once (TYPEPATH .      	'type-cinemacuts.php');                      // Carbon Cinema Cut Type
require_once (TYPEPATH .      	'type-creation.php');                        // Carbon Cinema Creation Type

// Include Carbon Paper widgets
require_once (WIDGETPATH .      'latestposts.php');                     // Carbon Paper Latest Posts
require_once (WIDGETPATH .      'categories-table.php');                // Carbon Paper Categories Table
require_once (WIDGETPATH .      'quick-access.php');                    // Carbon Paper Quick Access

// Change Excerpt lenght
add_filter('excerpt_length', 'cp_set_excerpt_length');


// Register Carbon Paper menus 
add_action( 'after_setup_theme', 'cp_set_menus' );


//require_once (TEMPLATEPATH .     '/test2.php');            
//exit();

// Register Carbon Paper Sidebar
if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
            'name' => 'Primary - Index',
            'before_widget' => '<div id="%1$s" class="widgetContainer %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgetTitle">',
            'after_title' => '</h3>'
    ));
    register_sidebar(array(
            'name' => 'Primary - Post',
            'before_widget' => '<div id="%1$s" class="widgetContainer %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgetTitle">',
            'after_title' => '</h3>'
    ));
    register_sidebar(array(
            'name' => 'Primary - About',
            'before_widget' => '<div id="%1$s" class="widgetContainer %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgetTitle">',
            'after_title' => '</h3>'
    ));
    register_sidebar(array(
            'name' => 'Primary - Selection',
            'before_widget' => '<div id="%1$s" class="widgetContainer %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgetTitle">',
            'after_title' => '</h3>'
    ));
    register_sidebar(array(
            'name' => 'Secondary - Shared',
            'before_widget' => '<div id="%1$s" class="widgetContainer %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgetTitle">',
            'after_title' => '</h3>'
    ));
} 

// Register legacy comments
add_filter('comments_template', 'cp_set_legacy_comments');
?>